import React, { Component } from 'react';
import { unitWidth } from '../constants/AdapterUtil';
import { View, Text, ActivityIndicator, StyleSheet } from 'react-native';
import Colors from '../constants/Colors';

export default class RefreshFooter extends Component {
    render() {
        if (this.props.showFoot == 1) {
            return (
                <View style={styles.footer}>
                    <View style={{ backgroundColor: Colors.color99, height: 0.5, width: 80 * unitWidth }} />
                    <Text style={{ color: '#999999', fontSize: 14, marginHorizontal: 20 * unitWidth }}>
                        我是有底线的
                    </Text>
                    <View style={{ backgroundColor: Colors.color99, height: 0.5, width: 80 * unitWidth }} />
                </View>
            );
        } else if (this.props.showFoot == 2) {
            return (
                <View style={styles.footer}>
                    <ActivityIndicator color={Colors.headerColor} />
                    <Text style={{ color: '#999999', fontSize: 14, marginLeft: 20 * unitWidth }}>正在加载更多数据...</Text>
                </View>
            );
        } else if (this.props.showFoot == 0) {
            return (
                <View>
                </View>
            );
        }
    }
}

const styles = StyleSheet.create({
    footer: {
        height: 50 * unitWidth,
        // height: 0 * unitWidth,
        alignItems: 'center', justifyContent: 'center', flexDirection: 'row'
    }
})